package com.his.controller;

import com.his.bean.DzmHisCarePkg;
import com.his.service.DzmHisCarePkgService;
import com.his.utils.ResponseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@RestController
public class DzmHisCarePkgController {
    @Autowired
    DzmHisCarePkgService DCPS;
//    收费总表（DzmHisCarePkg）查询
    @RequestMapping("/queryDzmHisCarePkg")
    @ResponseBody
    public Object queryDzmHisCarePkg(DzmHisCarePkg dzmHisCarePkg){
        List<DzmHisCarePkg> list=DCPS.queryDzmHisCarePkg(dzmHisCarePkg);
        System.out.println(dzmHisCarePkg+"前台form");
        System.out.println(list.size()+"收费总数据");
        return new ResponseResult(200,"收费总表查询成功",list);
    }

/**
* 查询总收入
* */
    @RequestMapping("getCarepkg")
    public ResponseResult getCarepkg(){
//        Map<String,String> carepkg=DCPS.getCarepkg();
//        ArrayList<Object> list=new ArrayList<>();
//        System.out.println(carepkg);
//
//        list.add(carepkg);
        List<Map> list=DCPS.getCarepkgs();

        return new ResponseResult(200,"统计图表查询",list);
    }


    /***
     * 查询各类收入
     */
    @RequestMapping("getType")
    public ResponseResult getType(){
        List<Map> list=DCPS.getType();
        return new ResponseResult(200,"各类收费",list);
    }


}
